package fr.ants.model.ai.heuristic;

/** 
 * <p>Heuristic distance using the Manhattan method (also know as taxi cab method).</p>
 * <p>Formula : Abs(x1 - x2) + Abs(y1 - y2)</p>
 *
 * @author Vianney DUPOY DE GUITARD
 */
public class Manhattan implements IHeuristic {

	/** {@inheritDoc} */
	public double evaluate(int x1, int y1, int x2, int y2) {
		return Math.abs(x1 - x2) + Math.abs(y1 - y2);
	}
}